{[j=20-/40/80!,o=95,a-]}					{ PasMat formatting options }

{Cameron Birse, Macintosh Technical Support}

PROGRAM ShowMonitors;

{$U-}

USES
		Memtypes,QuickDraw,OSIntf,ToolIntf,PackIntf,MacPrint,Script;

  
TYPE
  RectArray = array [1..6] of rect;

	VAR
		myStr		: Str255;
		err			: Integer;
		HPB			: HParamBlockRec; {Just use one parameter block for everything}
		HPBPtr		: HParmBlkPtr; {Here's the pointer to it}
  GDHdl : GDHandle;
  getOut,doneflag : boolean;
  MrIndex, HowMany, wRef : integer;
  PackORects : RectArray;
  wRecord : WindowRecord;
  MyWindow : WindowPtr;
  WRect,aRect : rect;
  
	{------------------------------------------------------------------------------------}
	
	 PROCEDURE Debugger; INLINE $A9FF;
 
{--------------------------------------------------------------------------------------------}
 
 Procedure DoInit;
 { Do all toolbox and global variable initialization neccessary }
 begin
   initgraf(@thePort);
   initFonts;
   initWindows;
   initMenus;
   TEInit;
   initDialogs(nil);
   initcursor;
   doneflag := false;
   GetDateTime(RandSeed);
 end; { procedure DoInit }
 
	{------------------------------------------------------------------------------------}

		BEGIN 							 {main PROGRAM}

    DoInit;   {Init them Mgrs.}

    getOut := false;
    
    wRef := 1;
    SetRect(WRect,40,40,450,300);		
    MyWindow := NewWindow (@wRecord, WRect, 'Hey Now!', true, documentProc, WindowPtr(-1), true, wRef);
    GDHdl := GetDeviceList;
    PackORects[1] := GDHdl^^.gdRect;
    
    MrIndex := 2;
    repeat
        begin
          GDHdl := GetNextDevice (GDHdl);
          if GDHdl <> nil then
           begin
            PackORects[MrIndex] := GDHdl^^.gdRect;
            HowMany := MrIndex;
            MrIndex := MrIndex + 1;
           end
          else getout := true
        end;
    until getout;
    
        
    For MrIndex := 1 to HowMany do
    begin
        aRect.top := (160+PackORects[MrIndex].top div 10);
        aRect.left := (205+PackORects[MrIndex].left div 10);
        aRect.bottom := (160+PackORects[MrIndex].bottom div 10);
        aRect.right := (205+PackORects[MrIndex].right div 10);
        FrameRect (aRect);
    end;
    
    repeat until button;
    
    CloseWindow (MyWindow);
        
    
End.